/*
 * @Author: ShengXD <1519256482@qq.com>
 * @Date: 2024-11-06 14:23:08
 * @LastEditors: ShengXD <1519256482@qq.com>
 * @LastEditTime: 2024-11-08 16:25:18
 * @FilePath: /zonmind-om/apps/web-antd/src/api/core/explanation.ts
 * @Description:
 */
import { requestClient } from '../request';

type ExplanationTableData = {
  list: [];
};

type SubaccountsTableData = {
  list: [];
};

type RoleTableData = {
  list: [];
};

/**
 * 获取名词解释列表
 */
export async function getExplanationTableData() {
  return requestClient.get<ExplanationTableData>('/fetchExplanationTableData');
}

/**
 * 获取子账号列表
 */
export async function getSubaccountsTableData(
  params?: SearchParams & PaginationParams,
) {
  return requestClient.get<SubaccountsTableData>(
    `/fetchSubaccountsTableData${!!params ? '?' + new URLSearchParams(params as Record<string, any>).toString() : ''}`,
  );
}

/**
 * 获取角色列表
 */
export async function getRoleTableData() {
  return requestClient.get<RoleTableData>('/fetchRoleTableData');
}

/**
 * 获取角色选择器
 */
export async function getRoleOptions() {
  return requestClient.get<any>('/fetchRoleOptions');
}

/**
 * 获取菜单列表
 */
export async function getSystemMenus(params?: PaginationParams) {
  return requestClient.get<any>(
    `/fetchSystemMenus${!!params ? '?' + new URLSearchParams(params as Record<string, any>).toString() : ''}`,
  );
}
